package com.xtj.testRabbitMQ;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkRabbitMQ {

    //一个消费者
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receivel(String msg){
        System.out.println("msg1="+msg);
    }
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receivel2(String msg){
        System.out.println("msg2="+msg);
    }
}
